home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
UTILITIE
/
CONVERSI
/
1396.ZIP
/
CCUR.DOC
< prev
next >
Wrap
Text File
|
1986-03-30
|
8KB
|
217 lines
COUNTING CURSOR
Rev. 1.1
(c) 1986 by Thomas A. Lundin
All Rights Reserved
BACKGROUND
In the course of my involvement in media conversion services -- for example,
taking a 9-track magnetic tape and transferring the data onto an IBM PC floppy
-- I am often given a data base file of some kind to be processed from a
fixed-length format to comma-delimited SDF or some such type. Usually, these
files are not accompanied by any record layout, so I must resort to calling up
a portion of the file using the TYPE command (or some screen editor) and
manually counting characters to establish the layout. Accuracy is critical, so
I'll usually go through this counting procedure at least twice until I'm
satisfied that the field lengths I've come up with are correct. The public
domain program RULER.COM had been a big help in giving me a visual point of
reference on the screen when counting across large voids of blank spaces.
Taking the idea behind RULER a step further, I wrote CCUR.EXE, the Counting
Cursor program.
CCUR places a movable cursor on a static screen display and lets your fingers
do the walking while the cursor does the counting. The counter can be toggled
on or off and initialized to zero or one anywhere on the screen, giving you a
quick count of the characters spanning two points.
Features of CCUR include a constantly-updated row/column coordinate readout;
the ability to jump to the top left, lower right, or center of the display, as
well as to the beginning or end of a line with a single keystroke; the ability
to skip forward or backward a specified number of characters from the current
point; the ability to write the displayed widths to a file for external
reference; and the ability to save the screen image in a disk file.
COUNTING CURSOR Page 1
OPERATION
Usage:
CCUR [ filename ]
The "filename" is optional. It creates a filename to which data will be
written when the Write Count and Save Screen commands are issued. If the
filename is not given, all file output will be directed to the screen. The DOS
device names PRN, CON, AUX, and NUL are acceptable filenames.
The current display is left as-is, but a status line is displayed on line 25
of the screen. A block cursor is positioned at the upper left corner of the
display.
THE STATUS LINE
The left portion of the status line lists which keys are valid operations in
CCUR; the right portion of the status line provides a readout of the current
counter value (or OFF), the value offset (0 or 1), and the current cursor
row/column coordinate.
Arrow Keys
These keys operate as you would expect them to.
HOME key
Places the cursor at the start of the current row, updates the counter
accordingly.
END key
Places the cursor at the end of the current row, updates the counter
accordingly.
PgUp key
Places the cursor in the upper left corner, updates the counter
accordingly.
PgDn key
Places the cursor in the lower right corner, updates the counter
accordingly.
5 key (num pad shift 5)
Places the cursor in the middle of the display area, updates the counter
accordingly.
Gray (-) key
Allows input of a numeric value to be subtracted from the current cursor
location. The cursor is positioned backward the number of characters
specified by the value, and the counter is updated. If the value would
cause the cursor to be displayed past the HOME position, the operation is
ignored.
COUNTING CURSOR Page 2
Gray (+) key
Allows input of a numeric value to be added to the current cursor
location. The cursor is positioned forward the number of characters
specified by the value, and the counter is updated. If the value would
cause the cursor to be displayed past the END position, the operation is
ignored.
'0' (zero)
Causes the base counter and coordinate values to begin at zero. This
command is provided for notational convenience, as you might be
accustomed to counting from zero.
'1' (one)
Causes the base counter and coordinate values to begin at one. This
command is provided for notational convenience, as you might be
accustomed to counting from one.
'C'ount
If the counter is currently OFF, this command turns the counter ON and
initializes it. If the counter is currently ON, this command turns the
counter OFF. An active counter can be cleared by pressing 'C' twice.
'W'rt
If the counter is ON, the current value in the counter display is
recorded in memory and will be written to a disk file when the program is
exited. The Wrt (Write Count) command can be executed multiple times;
each counter value recorded will be separated by a comma. The colon
following the word "Count" will blink to inform you that the recording
has taken place.
'*'Sv (unshifted PrtSc)
The current screen image will be saved to a disk file if a filename was
entered at the command prompt. Once the *Sv (Save Screen) command is
executed, the asterisk will blink to inform you that the feature is
active. Each saved screen line is terminated by a carriage return/line
feed combination and trailing blanks at the end of screen lines are
removed.
ESC key or 'E'
Exits back to DOS. If the Wrt or *Sv commands were used, their data will
be sent to the designated file before exiting. The default output file is
the screen, but it can be a disk file or even the printer if, at start-up
time, a filename follows the CCUR command (see the Usage, above).
COUNTING CURSOR Page 3
NOTES
PROGRAM INFORMATION:
CCUR was written in Lattice C, v 2.0, using the Dewar Advanced Editor, v 6.03.
Screen I/O routines from JCLIB.C by Dr. Jim Conn.
SYSTEM REQUIREMENTS:
IBM PC or compatible, 128K memory
DISCLAIMER:
This program is provided as-is. It is stable and bug-free on IBM PC and
compatible machines, and yet: It may not do what you want it to do, and it may
not work on your particular non-PC system.
LICENSE:
You may copy this program all you want. Share it. Upload it. Use it.
Don't charge any money for its distribution or use, unless a portion of what
you charge is contributed to me. Also, don't integrate this program with any
other program or commercial service and try to claim it's your property;
that's unethical and dishonorable.
BUG FIXES:
Ver. 1.1: Minor bug in Wrt command corrected to now record the displayed
value of the counter, as opposed to the zero offset value.
FINALLY:
If you find this program to be of value, contributions (up to $10) will be
gratefully accepted.
Send comments/bug reports/donations to:
Thomas A. Lundin
Graphics Unlimited Inc.
3000 Second Street North
Minneapolis, MN 55411
(612) 588-7571
COUNTING CURSOR Page 4